package com.bocloud.cmp.entity.resource;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;

/**
 * 
 * 镜像实体类
 * 
 * @author DZG
 * @since V1.0 2016年9月13日
 */
@Table("image")
public class Image extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("os_name")
	private String osName; // OS名称
	@Column("os_version")
	private String osVersion; // OS版本名称
	@Column("kernel_version")
	private String kernelVersion;// 内核版本
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@IgnoreAll
	private String vendorName; // 云供应商名称
	@Column("region")
	private Long region; // 镜像所在区域
	@IgnoreAll
	private String regionName; // 镜像所在区域名称
	@Column("image_id")
	private String imageId; // 镜像ID
	@Column("uuid")
	private String uuid; // UUID
	@Column("architecture")
	private String architecture; // 系统位数
	@Column("os_type")
	private String osType;// 系统类型
	@Column("size")
	private Double size;// 容量
	@Column("base")
	private String base;// 父镜像信息
	@Column("base_show")
	private String baseShow;//
	@Column("min_disk")
	private Long minDisk;// 作为系统的容量

	/**
	 * @return the kernelVersion
	 */
	public String getKernelVersion() {
		return kernelVersion;
	}

	/**
	 * @param kernelVersion
	 *            the kernelVersion to set
	 */
	public void setKernelVersion(String kernelVersion) {
		this.kernelVersion = kernelVersion;
	}

	/**
	 * @return the architecture
	 */
	public String getArchitecture() {
		return architecture;
	}

	/**
	 * @param architecture
	 *            the architecture to set
	 */
	public void setArchitecture(String architecture) {
		this.architecture = architecture;
	}

	/**
	 * @return the osType
	 */
	public String getOsType() {
		return osType;
	}

	/**
	 * @param osType
	 *            the osType to set
	 */
	public void setOsType(String osType) {
		this.osType = osType;
	}

	/**
	 * @return the size
	 */
	public Double getSize() {
		return size;
	}

	/**
	 * @param size
	 *            the size to set
	 */
	public void setSize(Double size) {
		this.size = size;
	}

	/**
	 * @return the base
	 */
	public String getBase() {
		return base;
	}

	/**
	 * @param base
	 *            the base to set
	 */
	public void setBase(String base) {
		this.base = base;
	}

	/**
	 * @return the baseShow
	 */
	public String getBaseShow() {
		return baseShow;
	}

	/**
	 * @param baseShow
	 *            the baseShow to set
	 */
	public void setBaseShow(String baseShow) {
		this.baseShow = baseShow;
	}

	/**
	 * @return the minDisk
	 */
	public Long getMinDisk() {
		return minDisk;
	}

	/**
	 * @param minDisk
	 *            the minDisk to set
	 */
	public void setMinDisk(Long minDisk) {
		this.minDisk = minDisk;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the osName
	 */
	public String getOsName() {
		return osName;
	}

	/**
	 * @param osName
	 *            the osName to set
	 */
	public void setOsName(String osName) {
		this.osName = osName;
	}

	/**
	 * @return the osVersion
	 */
	public String getOsVersion() {
		return osVersion;
	}

	/**
	 * @param osVersion
	 *            the osVersion to set
	 */
	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	/**
	 * @return the vendorId
	 */
	public Long getVendorId() {
		return vendorId;
	}

	/**
	 * @param vendorId
	 *            the vendorId to set
	 */
	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	/**
	 * @return the region
	 */
	public Long getRegion() {
		return region;
	}

	/**
	 * @param region
	 *            the region to set
	 */
	public void setRegion(Long region) {
		this.region = region;
	}

	/**
	 * @return the regionName
	 */
	public String getRegionName() {
		return regionName;
	}

	/**
	 * @param regionName
	 *            the regionName to set
	 */
	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	/**
	 * @return the vendorName
	 */
	public String getVendorName() {
		return vendorName;
	}

	/**
	 * @param vendorName
	 *            the vendorName to set
	 */
	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	/**
	 * @return the imageId
	 */
	public String getImageId() {
		return imageId;
	}

	/**
	 * @param imageId
	 *            the imageId to set
	 */
	public void setImageId(String imageId) {
		this.imageId = imageId;
	}

	/**
	 * @return the uuid
	 */
	public String getUuid() {
		return uuid;
	}

	/**
	 * @param uuid
	 *            the uuid to set
	 */
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public void preSave(Long createrId, Long menderId, Long vendorId) {
		this.setCreaterId(createrId);
		this.setMenderId(menderId);
		this.setVendorId(vendorId);
	}

}
